package L1;

import java.math.BigInteger;
import java.util.Scanner;

public class _046 {
    /**
     * 整除光棍
     * BigInteger的用法
     */
    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        BigInteger x = scanner.nextBigInteger();
        String s ="1";
        BigInteger bigInteger = new BigInteger(s);
        while (bigInteger.mod(x)!=BigInteger.ZERO){
            s+="1";
            bigInteger=new BigInteger(s);
        }
        BigInteger divide = bigInteger.divide(x);
        System.out.println(divide+" "+s.length());
    }
}
